package expression.primary;

import util.Result;
import util.Scope;
import util.Type;
import exception.ExpressionException;
import expression.PrimaryExpression;

public class Literal extends PrimaryExpression{

	String literalType = null;
	Object value = null;
	
	public Literal(Scope scope, String literalType, Object value) {
		this.literalType = literalType;
		this.value = value;
		this.result = new Result(new Type(literalType, false), null);
	}

	@Override
	public Result evaluate() throws ExpressionException {
		Type type = new Type(literalType, false);
		return new Result(type, value);
	}
	
	public String toString(){
		return "Literal [ type: " + literalType + ", value: " + value + "]"; 
	}

}
